//
//  GameScene.hpp
//  petgame
//
//  Created by zz on 2018/12/10.
//

#ifndef GameScene_hpp
#define GameScene_hpp

#include <stdio.h>
#include "cocos2d.h"
#include "ShopItem.hpp"
#include "Spirit.hpp"
#include "Player.hpp"
#include "ui/CocosGUI.h"
#include "ShopPanel.hpp"
#include <string>
#include "HelloWorldScene.h"
#include "ShopManager.hpp"
#include "ItemInfo.hpp"
#include "TipPanel.hpp"
#include "TouchEffect.hpp"
using namespace std;
using namespace ui;
using namespace cocos2d;

//游戏主场景

class GameScene:public Layer{
    
public:
    
    static Scene*createScene(int type);
    static GameScene* create(int type);
    bool init(int type);
public:
    
    void selectMenuByIndex(Ref*pSender);
    void initUI();
    void gotoShop();
    void gotoPlay();
    void gotoDector();
    void gotoEat();
    void goBack();
public:
    
    bool onTouchBegan(Touch*t,Event*e);
    void onTouchMoved(Touch*t,Event*e);
    void onTouchEnded(Touch*t,Event*e);
    void selectPlayThing(Ref*pSender);

public:
    
    void cleanTheFoodList(int index);
public:
    void spiritTimer(float dt);
    void hungerTimer(float dt);
    void happyTimer(float dt);
    
public:
    void toggleEatBtn();
    void remenber();
    void initStatus();
private:
    Spirit* k1;
    Spirit* k2;
    Spirit* k3;
private:
    
    int _type;
    Size visibleSize;
    Vec2 origin;
private:
    
    Player *player;

private:
    
    Sprite *panelLayer;
    Sprite *panelLayer2;
    Vector<Sprite*> _foodList;
    int values[5];
private:
    
    bool _isToEat;
    bool _isToSleep;
    bool _isToPlay;
    bool _isHold;
    bool _isSelectPlay;
    bool _isShowUnhappy;
    bool _isShowHung;
    bool _isShowTire;
    bool _isNothing;
    Sprite*_targetFood;
    Sprite* _playThing[3];
    Sprite* _targetPlayThing;
private:
    int _foodCount;
    int _selectIndexPlay;
    int selectindex;
};
#endif /* GameScene_hpp */
